package com.building.service;

import java.util.List;

import com.building.common.R;
import com.building.entity.Shopping;
import com.baomidou.mybatisplus.extension.service.IService;
/**
@author yinjiahui
@create 2021-04-11 17:11
*/
public interface ShoppingService extends IService<Shopping>{


    int updateBatch(List<Shopping> list);

    int updateBatchSelective(List<Shopping> list);

    int batchInsert(List<Shopping> list);

    int insertOrUpdate(Shopping record);

    int insertOrUpdateSelective(Shopping record);

    /**
     *  根据用户id查询购物车中所有物品
     * @param userId
     * @return
     */
    List<Shopping> selectShoppingByUserId(Integer userId);

    /**
     * 根据用户id和商品id删除商品
     * @param userId
     * @param shoppingId
     */
    void deleteShoppingByUserIdAndShoppingId(Integer userId, Integer shoppingId);

    /**
     *
     *  根据商品id查询购物车中商品的详细信息         //    回显
     *
     * @param shoppingId
     * @return
     */
    Shopping selectShoppingByShopping(Integer shoppingId);

    /**
     *
     * 新增或修改商品到购物车中
     *
     * @param shopping
     * @return
     */
    R insertOrUpdateShopping(Shopping shopping);

}
